#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include <QNetworkAccessManager>

#include <QListWidgetItem>
#include "ui_state.h"

namespace Ui {
  class MainWindow;
}

class RequestHandler;

class HomeView;
class ActivityCategoryView;
class PlaceCategoryView;

class MainWindow : public QMainWindow
{
  Q_OBJECT

public:
  explicit MainWindow(QWidget *parent = 0);
  virtual ~MainWindow();

  inline UIState State() const { return uiState_; }

  inline void SetState(UIState state) { uiState_ = state; }
public slots:
  void onItemClicked(QListWidgetItem *item);
  void RewindUI();

  // Switching views
  void showHomeView();
  void showPlaceView();
  void showActivityView();
  void showNearbyView();

private:
  void SetupCBA();
private:
  Ui::MainWindow *ui;
  QString imgUrl_;
  QNetworkAccessManager *manager_;
  RequestHandler *requestHandler_;

  HomeView *homeView_;
  ActivityCategoryView *activityCategoryView_;
  PlaceCategoryView *placeCategoryView_;

  UIState uiState_;

  QMenu *menu_;
};

#endif // MAINWINDOW_H
